//
//  ViewController2.m
//  IOS深入传值
//
//  Created by 江湖 on 2020/6/10.
//  Copyright © 2020 江湖. All rights reserved.
//

#import "ViewController2.h"
#import "UIViewController+Agent.h"
@interface ViewController2 ()
@property(nonatomic,weak)id<AgentDelegate> delegate;
@end

@implementation ViewController2

- (void)viewDidLoad {
    [super viewDidLoad];
    self.delegate = self.delegateVC;
    // Do any additional setup after loading the view from its nib.
}
- (IBAction)onClick:(UIButton *)sender {
    if (sender.tag == 1) {
//        代理协议
        [self.delegate agentFunc1];
    }else if(sender.tag == 2){
//        block
        self.viewBlock();
    }else if(sender.tag == 3){
//        通知
        
    }
        
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
